// invoked in worker